From 629948d53d10dbbdd39de326739bda86387fb3ca Mon Sep 17 00:00:00 2001 From: oliskoli Date: Tue, 25 Apr 2006 18:43:38 +0000 Subject: [PATCH] Remove tricky construct from coto-input. --- gpsbabel/coto.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/gpsbabel/coto.c b/gpsbabel/coto.c index 223768fd6..3b537d06a 100644 --- a/gpsbabel/coto.c +++ b/gpsbabel/coto.c @@ -22,6 +22,8 @@ */ +#include + #include "defs.h" #include "csv_util.h" #include "coldsync/palm.h" @@ -253,6 +255,7 @@ coto_wpt_read(struct pdb *pdb) for(pdb_rec = pdb->rec_index.rec; pdb_rec; pdb_rec=pdb_rec->next) { waypoint *wpt_tmp; + char *c; wpt_tmp = waypt_new(); @@ -266,8 +269,15 @@ coto_wpt_read(struct pdb *pdb) wpt_tmp->icon_descr = coto_get_icon_descr(pdb_rec->category, app); if (wpt_tmp->icon_descr) wpt_tmp->wpt_flags.icon_descr_is_dynamic = 1; - - wpt_tmp->notes = xstrdup(rec->notes); + + if ((c = strstr(rec->notes, "\nNotes:\n"))) { /* remove our contruct */ + wpt_tmp->notes = xstrdup(c + 8); + if (c != rec->notes) { + wpt_tmp->description = xstrndup(rec->notes, c - rec->notes); + } + } else { + wpt_tmp->notes = xstrdup(rec->notes); + } waypt_add(wpt_tmp); } -- 2.30.2